﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WZXC_GBL_QUERY;

namespace Net_SCADA
{
    public class KeyTime
    {
        public int KeyID { get; set; }
        public string KeyTimeName { get; set; }
        public DateTime MoveInTime { get; set; }
        public DateTime MoveOutTime { get; set; }
        public Dictionary<int , Zone> keyZone { get; set; } = new Dictionary<int , Zone>();
        public int KeyTimeInIndex { get; set; }//从0开始
        public int KeyTimeOutIndex { get; set; }
        public List<int> Alarmid { get; set; } = new List<int>();

        public List<int> PostionID { get; set; }
        //查询的时候就按照相关index在数据库里面进行数据的获取 keytime0~keytime40
        public void SetZoneID(string ids)
        {
            if (ids.Length > 0)
            {
                string[] s=ids.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries);
                int x=0;
                for (int i = 0 ; i < s.Length ; i++)
                {
                    if(int.TryParse(s[i],out int id))
                    {
                        if(QueryForms.fmquery.netline.zone.ContainsKey(id))
                            keyZone.Add(id , QueryForms.fmquery.netline.zone[id]);
                    }
                }
            }
        }
    }
}
